import java.util.Scanner;
class Point{
    double x;     double y;
    public double getX() {  return x;  }
    public void setX(double x) { this.x = x; }
    public double getY() {  return y;  }
    public void setY(double y) { this.y = y; }
}
class Line{
    Point startPoint;
    Point endPoint;
    void showLength(){
        //根据startPoint,endPoint计算线段长度
        double length=Math.sqrt((startPoint.x-endPoint.x)*(startPoint.x-endPoint.x)+
                (startPoint.y-endPoint.y)*(startPoint.y-endPoint.y));
        System.out.println("计算、输出线段的长度:"+length);
    }
}
public class MainP93_7 {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        System.out.println("请依次输入两个点的x、y坐标：");
        double x1=sc.nextDouble();
        double y1=sc.nextDouble();
        double x2=sc.nextDouble();
        double y2=sc.nextDouble();
        Point p1=new Point();//(0,4)  
        Point p2=new Point();//(3,0)
        p1.setX(x1);p1.setY(y1);
        p2.setX(x2);p2.setY(y2);
        Line l=new Line();
        l.startPoint=p1;
        l.endPoint=p2;
        l.showLength();
    }
}

